package com.dkm.ec.home.repository.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.home.domain.HomeQuestion;
import com.dkm.ec.home.persistence.dao.HomeQuestionQueryDao;
import com.dkm.ec.home.persistence.entity.HomeQuestionPo;
import com.dkm.ec.home.repository.HomeQuestionRepository;

/**
 * 对象功能:问答 Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:喻永淼
 * 创建时间:2015-01-07 10:41:07
 */
@Repository
public class HomeQuestionRepositoryImpl extends AbstractRepository<String, HomeQuestionPo,HomeQuestion> implements HomeQuestionRepository{
	  
	@Resource
	private  HomeQuestionQueryDao homeQuestionQueryDao;

	public HomeQuestion newInstance() {
		HomeQuestionPo po = new HomeQuestionPo();
		HomeQuestion homeQuestion = SpringHelper.getBean(HomeQuestion.class);
		homeQuestion.setData(po);
		return homeQuestion;
	}

	public HomeQuestion newInstance(HomeQuestionPo po) {
		HomeQuestion homeQuestion = SpringHelper.getBean(HomeQuestion.class);
		
		homeQuestion.setData(po);
		homeQuestion.loadRels();
		return homeQuestion;
	} 
	
	@Override
	protected IQueryDao<String, HomeQuestionPo> getQueryDao() {
		return homeQuestionQueryDao;
	}
	
}
